using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Collections.Generic;
/// <summary>
/// Summary description for Util
/// </summary>
public class Util:System.Web.UI.Page
{
    public Util()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    /// <summary>
    /// Read and return list of countries from file 'countries.txt'
    /// </summary>
    /// <returns></returns>
    public List<string> GetCountryList()
    {

        List<string> list = new List<string>();
        try
        {
            string filename = "";
           
            string st = "";
            filename = this.Server.MapPath("~/countries.txt");
            StreamReader sr = new StreamReader(filename);
            while ((st = sr.ReadLine()) != null)
            {
                list.Add(st);
            }
        }
        catch (FileNotFoundException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return list;
    }

}
